package com.dingding.service.activity.service;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import com.dingding.facde.activity.service.IWechatActivityService;
import com.dingding.service.activity.core.dao.IPromotionDayStatDao;
import com.dingding.service.activity.core.dao.IPromotionstatDao;

/**
 * @ClassName: ActivityServiceImpl
 * @Description: 活动模块的Service实现
 * @author yuHaiQing
 * @date 2016年3月24日 上午10:50:58
 */
@Component("wechatActivityService")
public class WechatActivityServiceImpl implements IWechatActivityService {

	private Logger log = Logger.getLogger(this.getClass());
	
	//微信公众号当天用户统计dao
	@Resource(name = "promotionDayStatDao")
	private IPromotionDayStatDao promotionDayStatDao;
	
	//微信公众号用户统计dao
	@Resource(name = "promotionstatDao")
	private IPromotionstatDao promotionstatDao;
	
	/**
	 * @Description: 增加推广商统计次数
	 * @param shopId 推广商id
	 * @author fengshuonan
	 */
	@Override
	public void addShopStatNum(Integer shopId) 
	{
		if(shopId == null || shopId == 0){
			log.error("增加推广商统计次数时，推广商id为空！");
			return ;
		}
		
		this.promotionDayStatDao.addPromotionNumByType(shopId);
	}


	/**
	 * @Description: 记录当天微信公众号关注数量
	 * @param shopId 推广商id
	 * @author fengshuonan
	 */
	@Override
	public void recordDayAttendNum() {
		
		this.promotionstatDao.recordDayAttendStat();
	}


}
